package tnp.util;

import org.aopalliance.intercept.MethodInvocation;
import org.aopalliance.intercept.MethodInterceptor;
import org.apache.log4j.Logger;

public class QualifyInterceptor implements MethodInterceptor 
{

	private static Logger log = Logger.getLogger( QualifyInterceptor.class );

	public Object invoke(MethodInvocation invocation) throws Throwable {
        String methodName = invocation.getMethod().getDeclaringClass().getName() + "#" + invocation.getMethod().getName();

        // 開始ログ
		log.info( "called : " + methodName );

        // メソッド実行
        Object returnObj = invocation.proceed();

        // 終了ログ
		log.info( "end    : " + methodName );

		return returnObj;
    }

}
